<template>
	<div>
		<div class="outer">
			<a-form :label-col="{span: 2}" :wrapper-col="{span: 14}">
				<a-form-item label="首页标签">
					<a-textarea v-model:value="value"
						placeholder="多个标签用英文逗号(,)分割"
						:auto-size="{ minRows: 5, maxRows: 5 }" />
				</a-form-item>
				<a-form-item class="marginButton" :wrapper-col="{ span: 14, offset: 2 }">
					<a-button type="primary" @click="onSubmit">保存</a-button>
					<a-popover placement="bottomLeft" class="m-l-20">
						<template #content>
							<img src="/src/assets/images/indexLabel.png" alt="" style="width: 600px;" />
						</template>
						<a-button>样式</a-button>
					</a-popover>
				</a-form-item>
			</a-form>
		</div>

	</div>
</template>

<script>
	import systemApi from '../../api/system.js'
	
	export default {
		data() {
			return {
				value: ''
			}
		},
		mounted() {
			this.getSystemConfig()
		},
		methods: {
			getSystemConfig(){
				systemApi.getSystemConfig('label').then(res => {
					if(res.status == 1){
						this.value = res.result.label
					}
				});
			},
			onSubmit() {				
				systemApi.systemConfig({label:this.value}).then(res => {
					if(res.status == 1){
						this.$message.success('修改成功')
					}
				})
			}
		}
	}
</script>
<style scoped>
</style>